"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var dgram = require("dgram");
// 创建一个 UDP 套接字  
var client = dgram.createSocket('udp4');
// 定义要发送的消息和地址信息  
var message = Buffer.from('Hello, UDP packet!');
var port = 41234;
var host = '127.0.0.1';
// 发送消息  
client.send(message, port, host, function (err) {
    if (err) {
        console.error('Error sending UDP packet:', err);
    }
    else {
        console.log('UDP packet sent successfully');
    }
    // 关闭套接字  
    client.close();
});
